//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ConnectParticipant service.
///
///    Participant Service actions     Participant Service data types    Amazon Connect is an easy-to-use omnichannel cloud contact center service that enables companies of any size to deliver superior customer service at a lower cost. Amazon Connect communications capabilities make it easy for companies to deliver personalized interactions across communication channels, including chat.  Use the Amazon Connect Participant Service to manage participants (for example, agents, customers, and managers listening in), and to send messages and events within a chat contact. The APIs in the service enable the following: sending chat messages, attachment sharing, managing a participant's connection state and message events, and retrieving chat transcripts.
public struct ConnectParticipant: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ConnectParticipant client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "ConnectParticipant",
            serviceIdentifier: "participant.connect",
            signingName: "execute-api",
            serviceProtocol: .restjson,
            apiVersion: "2018-09-07",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: ConnectParticipantErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "participant.connect-fips.us-east-1.amazonaws.com",
            "us-gov-west-1": "participant.connect.us-gov-west-1.amazonaws.com",
            "us-west-2": "participant.connect-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Cancels the authentication session. The opted out branch of the Authenticate Customer flow block will be taken.  The current supported channel is chat. This API is not supported for Apple Messages for Business, WhatsApp, or SMS chats.
    @Sendable
    @inlinable
    public func cancelParticipantAuthentication(_ input: CancelParticipantAuthenticationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelParticipantAuthenticationResponse {
        try await self.client.execute(
            operation: "CancelParticipantAuthentication", 
            path: "/participant/cancel-authentication", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels the authentication session. The opted out branch of the Authenticate Customer flow block will be taken.  The current supported channel is chat. This API is not supported for Apple Messages for Business, WhatsApp, or SMS chats.
    ///
    /// Parameters:
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - sessionId: The sessionId provided in the authenticationInitiated event.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelParticipantAuthentication(
        connectionToken: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelParticipantAuthenticationResponse {
        let input = CancelParticipantAuthenticationRequest(
            connectionToken: connectionToken, 
            sessionId: sessionId
        )
        return try await self.cancelParticipantAuthentication(input, logger: logger)
    }

    /// Allows you to confirm that the attachment has been uploaded using the pre-signed URL provided in StartAttachmentUpload API. A conflict exception is thrown when an attachment with that identifier is already being uploaded. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func completeAttachmentUpload(_ input: CompleteAttachmentUploadRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CompleteAttachmentUploadResponse {
        try await self.client.execute(
            operation: "CompleteAttachmentUpload", 
            path: "/participant/complete-attachment-upload", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Allows you to confirm that the attachment has been uploaded using the pre-signed URL provided in StartAttachmentUpload API. A conflict exception is thrown when an attachment with that identifier is already being uploaded. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - attachmentIds: A list of unique identifiers for the attachments.
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - logger: Logger use during operation
    @inlinable
    public func completeAttachmentUpload(
        attachmentIds: [String],
        clientToken: String = CompleteAttachmentUploadRequest.idempotencyToken(),
        connectionToken: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CompleteAttachmentUploadResponse {
        let input = CompleteAttachmentUploadRequest(
            attachmentIds: attachmentIds, 
            clientToken: clientToken, 
            connectionToken: connectionToken
        )
        return try await self.completeAttachmentUpload(input, logger: logger)
    }

    /// Creates the participant's connection.  For security recommendations, see Amazon Connect Chat security best practices.   ParticipantToken is used for invoking this API instead of ConnectionToken.  The participant token is valid for the lifetime of the participant – until they are part of a contact. The response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.  For chat, you need to publish the following on the established websocket connection:  {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}  Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.  Message streaming support: This API can also be used together with the StartContactStreaming API to create a participant connection for chat contacts that are not using a websocket. For more information about message streaming, Enable real-time chat message streaming in the Amazon Connect Administrator Guide.  Feature specifications: For information about feature specifications, such as the allowed number of open websocket connections per participant, see Feature specifications in the Amazon Connect Administrator Guide.   The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func createParticipantConnection(_ input: CreateParticipantConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateParticipantConnectionResponse {
        try await self.client.execute(
            operation: "CreateParticipantConnection", 
            path: "/participant/connection", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates the participant's connection.  For security recommendations, see Amazon Connect Chat security best practices.   ParticipantToken is used for invoking this API instead of ConnectionToken.  The participant token is valid for the lifetime of the participant – until they are part of a contact. The response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.  For chat, you need to publish the following on the established websocket connection:  {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}  Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.  Message streaming support: This API can also be used together with the StartContactStreaming API to create a participant connection for chat contacts that are not using a websocket. For more information about message streaming, Enable real-time chat message streaming in the Amazon Connect Administrator Guide.  Feature specifications: For information about feature specifications, such as the allowed number of open websocket connections per participant, see Feature specifications in the Amazon Connect Administrator Guide.   The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - connectParticipant: Amazon Connect Participant is used to mark the participant as connected for customer participant in message streaming, as well as for agent or manager participant in non-streaming chats.
    ///   - participantToken: This is a header parameter. The ParticipantToken as obtained from StartChatContact API response.
    ///   - type: Type of connection information required. If you need CONNECTION_CREDENTIALS along with marking participant as connected, pass CONNECTION_CREDENTIALS in Type.
    ///   - logger: Logger use during operation
    @inlinable
    public func createParticipantConnection(
        connectParticipant: Bool? = nil,
        participantToken: String,
        type: [ConnectionType]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateParticipantConnectionResponse {
        let input = CreateParticipantConnectionRequest(
            connectParticipant: connectParticipant, 
            participantToken: participantToken, 
            type: type
        )
        return try await self.createParticipantConnection(input, logger: logger)
    }

    /// Retrieves the view for the specified view token. For security recommendations, see Amazon Connect Chat security best practices.
    @Sendable
    @inlinable
    public func describeView(_ input: DescribeViewRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeViewResponse {
        try await self.client.execute(
            operation: "DescribeView", 
            path: "/participant/views/{ViewToken}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the view for the specified view token. For security recommendations, see Amazon Connect Chat security best practices.
    ///
    /// Parameters:
    ///   - connectionToken: The connection token.
    ///   - viewToken: An encrypted token originating from the interactive message of a ShowView block operation. Represents the desired view.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeView(
        connectionToken: String,
        viewToken: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeViewResponse {
        let input = DescribeViewRequest(
            connectionToken: connectionToken, 
            viewToken: viewToken
        )
        return try await self.describeView(input, logger: logger)
    }

    /// Disconnects a participant.  For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func disconnectParticipant(_ input: DisconnectParticipantRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisconnectParticipantResponse {
        try await self.client.execute(
            operation: "DisconnectParticipant", 
            path: "/participant/disconnect", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disconnects a participant.  For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - logger: Logger use during operation
    @inlinable
    public func disconnectParticipant(
        clientToken: String? = DisconnectParticipantRequest.idempotencyToken(),
        connectionToken: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisconnectParticipantResponse {
        let input = DisconnectParticipantRequest(
            clientToken: clientToken, 
            connectionToken: connectionToken
        )
        return try await self.disconnectParticipant(input, logger: logger)
    }

    /// Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func getAttachment(_ input: GetAttachmentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetAttachmentResponse {
        try await self.client.execute(
            operation: "GetAttachment", 
            path: "/participant/attachment", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - attachmentId: A unique identifier for the attachment.
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - urlExpiryInSeconds: The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
    ///   - logger: Logger use during operation
    @inlinable
    public func getAttachment(
        attachmentId: String,
        connectionToken: String,
        urlExpiryInSeconds: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetAttachmentResponse {
        let input = GetAttachmentRequest(
            attachmentId: attachmentId, 
            connectionToken: connectionToken, 
            urlExpiryInSeconds: urlExpiryInSeconds
        )
        return try await self.getAttachment(input, logger: logger)
    }

    /// Retrieves the AuthenticationUrl for the current authentication session for the AuthenticateCustomer flow block.  For security recommendations, see Amazon Connect Chat security best practices.    This API can only be called within one minute of receiving the authenticationInitiated event.   The current supported channel is chat. This API is not supported for Apple Messages for Business, WhatsApp, or SMS chats.
    @Sendable
    @inlinable
    public func getAuthenticationUrl(_ input: GetAuthenticationUrlRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetAuthenticationUrlResponse {
        try await self.client.execute(
            operation: "GetAuthenticationUrl", 
            path: "/participant/authentication-url", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the AuthenticationUrl for the current authentication session for the AuthenticateCustomer flow block.  For security recommendations, see Amazon Connect Chat security best practices.    This API can only be called within one minute of receiving the authenticationInitiated event.   The current supported channel is chat. This API is not supported for Apple Messages for Business, WhatsApp, or SMS chats.
    ///
    /// Parameters:
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - redirectUri: The URL where the customer will be redirected after Amazon Cognito authorizes the user.
    ///   - sessionId: The sessionId provided in the authenticationInitiated event.
    ///   - logger: Logger use during operation
    @inlinable
    public func getAuthenticationUrl(
        connectionToken: String,
        redirectUri: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetAuthenticationUrlResponse {
        let input = GetAuthenticationUrlRequest(
            connectionToken: connectionToken, 
            redirectUri: redirectUri, 
            sessionId: sessionId
        )
        return try await self.getAuthenticationUrl(input, logger: logger)
    }

    /// Retrieves a transcript of the session, including details about any attachments. For information about accessing past chat contact transcripts for a persistent chat, see Enable persistent chat.  For security recommendations, see Amazon Connect Chat security best practices. If you have a process that consumes events in the transcript of an chat that has ended, note that chat transcripts contain the following event content types if the event has occurred during the chat session:    application/vnd.amazonaws.connect.event.participant.left     application/vnd.amazonaws.connect.event.participant.joined     application/vnd.amazonaws.connect.event.chat.ended     application/vnd.amazonaws.connect.event.transfer.succeeded     application/vnd.amazonaws.connect.event.transfer.failed      ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func getTranscript(_ input: GetTranscriptRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTranscriptResponse {
        try await self.client.execute(
            operation: "GetTranscript", 
            path: "/participant/transcript", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a transcript of the session, including details about any attachments. For information about accessing past chat contact transcripts for a persistent chat, see Enable persistent chat.  For security recommendations, see Amazon Connect Chat security best practices. If you have a process that consumes events in the transcript of an chat that has ended, note that chat transcripts contain the following event content types if the event has occurred during the chat session:    application/vnd.amazonaws.connect.event.participant.left     application/vnd.amazonaws.connect.event.participant.joined     application/vnd.amazonaws.connect.event.chat.ended     application/vnd.amazonaws.connect.event.transfer.succeeded     application/vnd.amazonaws.connect.event.transfer.failed      ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - contactId: The contactId from the current contact chain for which transcript is needed.
    ///   - maxResults: The maximum number of results to return in the page. Default: 10.
    ///   - nextToken: The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.
    ///   - scanDirection: The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition.
    ///   - sortOrder: The sort order for the records. Default: DESCENDING.
    ///   - startPosition: A filtering option for where to start.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTranscript(
        connectionToken: String,
        contactId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        scanDirection: ScanDirection? = nil,
        sortOrder: SortKey? = nil,
        startPosition: StartPosition? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTranscriptResponse {
        let input = GetTranscriptRequest(
            connectionToken: connectionToken, 
            contactId: contactId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            scanDirection: scanDirection, 
            sortOrder: sortOrder, 
            startPosition: startPosition
        )
        return try await self.getTranscript(input, logger: logger)
    }

    ///  The application/vnd.amazonaws.connect.event.connection.acknowledged ContentType will no longer be supported starting December 31, 2024. This event has been migrated to the CreateParticipantConnection API using the ConnectParticipant field.  Sends an event. Message receipts are not supported when there are more than two active participants in the chat. Using the SendEvent API for message receipts when a supervisor is barged-in will result in a conflict exception. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func sendEvent(_ input: SendEventRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SendEventResponse {
        try await self.client.execute(
            operation: "SendEvent", 
            path: "/participant/event", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  The application/vnd.amazonaws.connect.event.connection.acknowledged ContentType will no longer be supported starting December 31, 2024. This event has been migrated to the CreateParticipantConnection API using the ConnectParticipant field.  Sends an event. Message receipts are not supported when there are more than two active participants in the chat. Using the SendEvent API for message receipts when a supervisor is barged-in will result in a conflict exception. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - content: The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string. Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"
    ///   - contentType: The content type of the request. Supported types are:   application/vnd.amazonaws.connect.event.typing   application/vnd.amazonaws.connect.event.connection.acknowledged (will be deprecated on December 31, 2024)    application/vnd.amazonaws.connect.event.message.delivered   application/vnd.amazonaws.connect.event.message.read
    ///   - logger: Logger use during operation
    @inlinable
    public func sendEvent(
        clientToken: String? = SendEventRequest.idempotencyToken(),
        connectionToken: String,
        content: String? = nil,
        contentType: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SendEventResponse {
        let input = SendEventRequest(
            clientToken: clientToken, 
            connectionToken: connectionToken, 
            content: content, 
            contentType: contentType
        )
        return try await self.sendEvent(input, logger: logger)
    }

    /// Sends a message. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func sendMessage(_ input: SendMessageRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SendMessageResponse {
        try await self.client.execute(
            operation: "SendMessage", 
            path: "/participant/message", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sends a message. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - connectionToken: The authentication token associated with the connection.
    ///   - content: The content of the message.    For text/plain and text/markdown, the Length Constraints are Minimum of 1, Maximum of 1024.    For application/json, the Length Constraints are Minimum of 1, Maximum of 12000.    For application/vnd.amazonaws.connect.message.interactive.response, the Length Constraints are Minimum of 1, Maximum of 12288.
    ///   - contentType: The type of the content. Supported types are text/plain, text/markdown, application/json, and application/vnd.amazonaws.connect.message.interactive.response.
    ///   - logger: Logger use during operation
    @inlinable
    public func sendMessage(
        clientToken: String? = SendMessageRequest.idempotencyToken(),
        connectionToken: String,
        content: String,
        contentType: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SendMessageResponse {
        let input = SendMessageRequest(
            clientToken: clientToken, 
            connectionToken: connectionToken, 
            content: content, 
            contentType: contentType
        )
        return try await self.sendMessage(input, logger: logger)
    }

    /// Provides a pre-signed Amazon S3 URL in response for uploading the file directly to S3. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    @Sendable
    @inlinable
    public func startAttachmentUpload(_ input: StartAttachmentUploadRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartAttachmentUploadResponse {
        try await self.client.execute(
            operation: "StartAttachmentUpload", 
            path: "/participant/start-attachment-upload", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides a pre-signed Amazon S3 URL in response for uploading the file directly to S3. For security recommendations, see Amazon Connect Chat security best practices.   ConnectionToken is used for invoking this API instead of ParticipantToken.  The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
    ///
    /// Parameters:
    ///   - attachmentName: A case-sensitive name of the attachment being uploaded.
    ///   - attachmentSizeInBytes: The size of the attachment in bytes.
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - contentType: Describes the MIME file type of the attachment. For a list of supported file types, see Feature specifications in the Amazon Connect Administrator Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func startAttachmentUpload(
        attachmentName: String,
        attachmentSizeInBytes: Int64 = 0,
        clientToken: String = StartAttachmentUploadRequest.idempotencyToken(),
        connectionToken: String,
        contentType: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartAttachmentUploadResponse {
        let input = StartAttachmentUploadRequest(
            attachmentName: attachmentName, 
            attachmentSizeInBytes: attachmentSizeInBytes, 
            clientToken: clientToken, 
            connectionToken: connectionToken, 
            contentType: contentType
        )
        return try await self.startAttachmentUpload(input, logger: logger)
    }
}

extension ConnectParticipant {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ConnectParticipant, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ConnectParticipant {
    /// Return PaginatorSequence for operation ``getTranscript(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getTranscriptPaginator(
        _ input: GetTranscriptRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetTranscriptRequest, GetTranscriptResponse> {
        return .init(
            input: input,
            command: self.getTranscript,
            inputKey: \GetTranscriptRequest.nextToken,
            outputKey: \GetTranscriptResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getTranscript(_:logger:)``.
    ///
    /// - Parameters:
    ///   - connectionToken: The authentication token associated with the participant's connection.
    ///   - contactId: The contactId from the current contact chain for which transcript is needed.
    ///   - maxResults: The maximum number of results to return in the page. Default: 10.
    ///   - scanDirection: The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition.
    ///   - sortOrder: The sort order for the records. Default: DESCENDING.
    ///   - startPosition: A filtering option for where to start.
    ///   - logger: Logger used for logging
    @inlinable
    public func getTranscriptPaginator(
        connectionToken: String,
        contactId: String? = nil,
        maxResults: Int? = nil,
        scanDirection: ScanDirection? = nil,
        sortOrder: SortKey? = nil,
        startPosition: StartPosition? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetTranscriptRequest, GetTranscriptResponse> {
        let input = GetTranscriptRequest(
            connectionToken: connectionToken, 
            contactId: contactId, 
            maxResults: maxResults, 
            scanDirection: scanDirection, 
            sortOrder: sortOrder, 
            startPosition: startPosition
        )
        return self.getTranscriptPaginator(input, logger: logger)
    }
}

extension ConnectParticipant.GetTranscriptRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ConnectParticipant.GetTranscriptRequest {
        return .init(
            connectionToken: self.connectionToken,
            contactId: self.contactId,
            maxResults: self.maxResults,
            nextToken: token,
            scanDirection: self.scanDirection,
            sortOrder: self.sortOrder,
            startPosition: self.startPosition
        )
    }
}
